package com.grp6.game.view;

import java.util.Arrays;

import com.grp6.game.model.AbstractObservableModel;
import com.grp6.game.ui.platform.IActionListener;

public abstract class AbstractView<M extends AbstractObservableModel> implements IView<M>{
	protected M model;

	@Override
	public M getModel() {
		return model;
	}
	
	public void setModel(M model){
		this.model = model;
		model.getViews().remove(this);
		model.removeObserver(Arrays.asList(this));
		
		model.getViews().add(this);
		model.addObservers(Arrays.asList(this));
	}

}
